<template>
	<view style="width: 100%;height: 100%;background-color: #fff;">
		<view style="width: 100%;display: flex;flex-direction: row;justify-content: center;margin-top: 150rpx;">
			<image src="../../static/tabbar4_.png" style="width: 150rpx;height: 150rpx;">

			</image>
		</view>
		<view style="width: 750rpx;margin-top: 100rpx;">
			<button open-type="getPhoneNumber" form-type="submit" @getphonenumber="getPhone()" class="buttonView" @click="dengLu()">手机号快捷登录</button>
		</view>
		<view style="width: 100%;display: flex;
		flex-direction: row;justify-content: center;align-items: center;
		margin-top: 50rpx;">
			<checkbox :checked="isXuanZhong" @click="xuanZhong()"
			
			 backgroundColor="#fff" activeBackgroundColor="#d10e1c"
				iconColor="#fff"></checkbox>
			<view style="color:#999999;font-size: 24rpx;">登录代表您同意</view>
			<view style="color:#d10e1c;font-size: 24rpx;">房查查服务协议、隐私政策</view>
		</view>

	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				isXuanZhong: false
			}
		},
		onLoad() {
			that = this;
		},
		methods: {
			xuanZhong() {
				that.isXuanZhong = !that.isXuanZhong;
			},
			dengLu() {
				if (!that.isXuanZhong) {
					uni.showModal({
						title: '登录提示',
						content: '请同意服务协议、隐私政策',
						showCancel: false,
						success: res => {

						}
					});
				}
				uni.login({
					provider: 'weixin',
					success(res) {
						console.log(res);
					},
					fail(res) {

					}
				});
			
			},
			getPhone(res){
				console.log("res===",res);
			},
			getPhoneSuss(res) {
				console.log(res);
			},
			getPhoneFail(msg) {
				console.log(msg);
			}
		}
	
	}
</script>

<style>
	.buttonView {
		width: 650rpx;
		margin: 50rpx;
		border-radius: 10rpx;
		border: 1rpx solid #ffb6af;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		font-size: 35rpx;
		color: #666666;
		background-color: #fff;
	}
</style>